"""
Project Name : api_automation_framework
File Name : image-save.py.py
Author : lldhsds
Date : 2024/12/29 14:28
Description: 
"""

import requests

headers = {'Accept': 'image/webp'}
response = requests.get("https://httpbin.org/image", headers=headers)
if response.status_code == 200:
    with open("image.webp", 'wb') as f:
        f.write(response.content)
    print("PNG 图片已保存")
else:
    print(f"请求失败，状态码: {response.status_code}")
